package com.atguigu.seckill.util;

import org.springframework.util.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*校验类/*/
public class ValidatorUtil {

    //校验电话号码
    private static final Pattern mobile_patten =Pattern.compile("[1]([3-9])[0-9]{9}$");
    //判断
    public static boolean isMobile(String mobile){
        if(StringUtils.isEmpty(mobile)){
            return false;
        }
        Matcher matcher =mobile_patten.matcher(mobile);
        return matcher.matches();
    }
}
